#ifndef VISBASEWIDGET_H
#define VISBASEWIDGET_H

#include <QString>
#include <QGraphicsWidget>
#include <QGraphicsItem>
#include <QDebug>
#include <QRectF>
#include <QPainterPath>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#include <QWidget>
#include <QFile>
#include <QGraphicsScene>
#include <QCursor>

class SageVis;
class ResizeRect;

class VisBaseWidget : public QGraphicsWidget
{

    Q_OBJECT

public:
    VisBaseWidget(SageVis *svp = 0, QGraphicsItem *parent = 0);
    ~VisBaseWidget();

    virtual bool loadData(QString pathToData);

    QRectF boundingRect() const;
    QPainterPath shape() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
               QWidget *widget);

    void resize(qreal w, qreal h);

public slots:
    void advance();

protected:
    float widthPercOfScene;
    float heightPercOfScene;
    float sceneWidth;
    float sceneHeight;

    ResizeRect* resizeRect;//note- resizing turned off for now

    SageVis* sageVisParent;
};

//Note on resizing:
//principle:  resizeRect would be drawn when user hovers over it
//on click and drag in resize rect, resize() function would be called on
//parent visbasewidget
//problem:  child widgets not auto-resize as expected.  Not sure if it is
//because I implemented boundingRect in child widgets with fixed variables width and height


#endif // VISBASEWIDGET_H
